Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EOAssociationClasses 
(informal protocol)

Category Of:	Object

Declared In:	eointerface/EOAssociation.h

Category Description

This category declares the associationClass method, which allows a user interface object to declare what subclass of EOAssociation should be used to tie it to an EOController. You can use this method at run time to determine what kind of association to create for a given user interface object. The Object class declares this category, but doesn't define it; you should check an object with respondsTo: before sending an associationClass message. See the EOController class specification for an example of creating an association for a user interface object.

associationClass is used when an object is unarchived to form an association between a controller and a user interface object. For example, all associations in a nib file are created by using this method when your application loads the nib file. If you want an archived user interface object to use your custom association class, you should implement associationClass in a category on that user interface object class.

Although this method allows you to determine at run time what subclass of EOAssociation will work with a particular user interface object, you don't have to use that subclass. You can use any association class designed to work with that user interface object, explicitly specifying the class when creating associations in your code.

Redefining Association Classes for NEXTSTEP Classes

The Enterprise Objects Framework defines the associationClass method for many user interface object classes; for example, Button's implementation returns the EOButtonAssociation class, and TextField's returns EOControlAssociation. If you create your own association subclasses to be used with these classes, your application or Interface Builder palette can define categories of these classes that override associationClass. Because your code is loaded after the NEXTSTEP and EOInterface libraries, your definitions of this method will replace the libraries'. This allows you to customize the behavior of any user interface object classÐin your application and in Interface BuilderÐwith respect to an EOController.

Instance Methods

associationClass

- (Class)associationClass 

Returns the subclass of EOAssociation that should be used with the receiver. For example, NXImageView's implementation of this method returns the EOImageAssociation class.